<template>
  <div class="maincontent">
      <el-card class="box-card">
        <div class="breadcrumb" slot="header">
          <el-breadcrumb separator="/">
            <el-breadcrumb-item :to="{name:'品牌信息'}">品牌信息</el-breadcrumb-item>
              <el-breadcrumb-item >编辑品牌信息</el-breadcrumb-item>
          </el-breadcrumb>
        </div>
        <div class="boxtitle">
          <div class="title">
            编辑店面信息
          </div>
        </div>

        <div class="textinfo">
          <el-row :gutter="40">
            <el-col :span="12">
                <el-form label-width="100px">
                  <el-form-item label="品牌名称:">
                    <el-input v-model.trim="info.store_name" ></el-input>
                  </el-form-item>
                  <el-form-item label="店面地址:">
                      <el-input v-model.trim="info.store_adress" ></el-input>
                  </el-form-item>
                  <el-form-item label="注册地址:">
                      <el-input v-model.trim="info.registered_address" ></el-input>
                  </el-form-item>
                </el-form>
            </el-col>
            <el-col :span="12">
              <el-form label-width="100px">
                <el-form-item label="联系电话:">
                    <el-input v-model.trim="info.store_phone" ></el-input>
                </el-form-item>
                <el-form-item label="联系邮箱:">
                    <el-input v-model.trim="info.store_email" ></el-input>
                </el-form-item>
              </el-form>
            </el-col>

          </el-row>
          <el-row>
            <div style="margin-top: 50px;text-align: center">
                <el-button type="primary" size="large" @click="edi">保 存</el-button>
            </div>
          </el-row>
        </div>

      </el-card>
  </div>
</template>
<script type="text/ecmascript-6">
  import API from "../API"
export default{
  data(){
    return{
      info:{}
    }
  },
  mounted(){
    let infostr=window.sessionStorage.getItem("storeinfo");
    this.info=JSON.parse(infostr)
  },
  methods:{
    edi(){
      API.updbrandstore({
        store_id:this.info.store_id,
        store_name:this.info.store_name,
        registered_address:this.info.registered_address,
        store_legal:this.info.store_legal,
        store_phone:this.info.store_phone,
        store_email:this.info.store_email,
        store_adress:this.info.store_adress
      }).then((res)=>{
        let json=res.data;
        if (json.message=="success"){
          this.$notify({
            title: '成功',
            message: '修改成功',
            type: 'success'
          });
        }else {
          this.$notify({
            title: '失败',
            message: '修改失败',
            type: 'error'
          });
        }
      })
    }
  }
}
</script>
<style lang="less">
@import "../css/common.less";
</style>
